package com.caoaman.sharding.controller;

import com.caoaman.sharding.model.TOrder;
import com.caoaman.sharding.service.ITOrderService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * @ClassName: TOrderController
 * @Description: 订单前端控制器
 * @Author: CaoAMan
 * @Create: 2021-12-17 16:29
 */
@RestController
@RequestMapping("tOrder")
public class TOrderController {

    @Resource
    private ITOrderService orderService;

    @PostMapping("add")
    public void add(@RequestBody TOrder order) {
        orderService.save(order);
    }

    @GetMapping("query")
    public List<TOrder> query() {
        return orderService.list();
    }
}
